package com.zzy.liteflow.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yomahub.liteflow.core.FlowExecutor;
import com.zzy.liteflow.common.TopChain;

@RequestMapping("/chain")
@Controller
public class ChainController {
	
	@Resource
	FlowExecutor flowExecutor;
	
    @Autowired
    JdbcTemplate jdbcTemplate;
	
	
	@RequestMapping("/add")
	@ResponseBody
	public String add(HttpServletRequest request, TopChain topChain) {
		jdbcTemplate.execute(
				"INSERT INTO EL_TABLE (APPLICATION_NAME,CHAIN_NAME,EL_DATA) values ('demo','chain6','THEN(a, x3);');");
		return "success";
	}

}
